package com.sc.nft.mapper;

import com.sc.nft.entity.MarketManagementDaoPool;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 市值管理结算池 Mapper 接口
 * </p>
 *
 * @author liGen
 * @since 2024-07-23
 */
@Mapper
public interface MarketManagementDaoPoolMapper extends BaseMapper<MarketManagementDaoPool> {

    /**
     * 获取当前时期的市值结算池
     *
     * @param ecologyHatchId
     * @param collectionId
     * @return
     */
    MarketManagementDaoPool getOneByEcologyHatchId(@Param("ecologyHatchId") Long ecologyHatchId, @Param("collectionId") Long collectionId, @Param("daoId") Long daoId, @Param("now") Date now);

    /**
     * 获取时间点的所有市值管理池子
     *
     * @param now
     * @return
     */
    List<MarketManagementDaoPool> getLastPools(@Param("now") Date now);

    /**
     * @param id
     * @param amount
     * @return
     */
    Boolean addAmount(@Param("id") Long id, @Param("amount") BigDecimal amount);


    MarketManagementDaoPool getLockPool(@Param("ecologyHatchId") Long ecologyHatchId, @Param("collectionId") Long collectionId, @Param("daoId") Long daoId, @Param("settlePoolId") Long settlePoolId, @Param("settlePoolStartTime") Date settlePoolStartTime);
}
